package com.bawei.mall.search.service.impl;

import com.bawei.mall.product.domain.Advertise;
import com.bawei.mall.search.mapper.AdvertiseMapper;
import com.bawei.mall.search.service.IAdvertiseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 广告Service业务层处理
 *
 * @author DongZeLiang
 * @date 2024-07-01
 */
@Service
public class AdvertiseServiceImpl implements IAdvertiseService
{
    @Autowired
    private AdvertiseMapper advertiseMapper;

    /**
     * 查询广告
     *
     * @param id 广告主键
     * @return 广告
     */
    @Override
    public Advertise selectAdvertiseById(Long id)
    {
        return advertiseMapper.selectAdvertiseById(id);
    }

    /**
     * 查询广告列表
     *
     * @param advertise 广告
     * @return 广告
     */
    @Override
    public List<Advertise> selectAdvertiseList(Advertise advertise)
    {
        return advertiseMapper.selectAdvertiseList(advertise);
    }

    /**
     * 新增广告
     *
     * @param advertise 广告
     * @return 结果
     */
    @Override
    public int insertAdvertise(Advertise advertise)
    {
        return advertiseMapper.insertAdvertise(advertise);
    }

    /**
     * 修改广告
     *
     * @param advertise 广告
     * @return 结果
     */
    @Override
    public int updateAdvertise(Advertise advertise)
    {
        return advertiseMapper.updateAdvertise(advertise);
    }

    /**
     * 批量删除广告
     *
     * @param ids 需要删除的广告主键
     * @return 结果
     */
    @Override
    public int deleteAdvertiseByIds(Long[] ids)
    {
        return advertiseMapper.deleteAdvertiseByIds(ids);
    }

    /**
     * 删除广告信息
     *
     * @param id 广告主键
     * @return 结果
     */
    @Override
    public int deleteAdvertiseById(Long id)
    {
        return advertiseMapper.deleteAdvertiseById(id);
    }
}
